import 'package:flutter/material.dart';

class OutlineText extends StatelessWidget {
  final String text;
  final TextStyle? outlineStyle;
  final TextStyle? style;
  final double? fontSize;
  final Color? foregroundColor;
  final Color? color;
  final double? strokeWidth;
  final String? fontFamily;
  const OutlineText({
    super.key,
    this.text = "",
    this.fontFamily,
    this.outlineStyle,
    this.style,
    this.fontSize,
    this.color,
    this.foregroundColor,
    this.strokeWidth,
  });

  @override
  Widget build(BuildContext context) {
    return Stack(
      alignment: Alignment.center,
      children: [
        Text(
          text,
          style: outlineStyle ??
              TextStyle(
                  fontSize: fontSize ?? 20,
                  fontWeight: FontWeight.bold,
                  fontFamily: fontFamily,
                  foreground: Paint()
                    ..style = PaintingStyle.stroke
                    ..strokeWidth = strokeWidth ?? 4
                    ..color = foregroundColor ?? Colors.black),
        ),
        Text(
          text,
          style: style ??
              TextStyle(
                  fontSize: fontSize ?? 20,
                  fontFamily: fontFamily,
                  fontWeight: FontWeight.bold,
                  color: color ?? Colors.white),
        ),
      ],
    );
  }
}
